<template>
  <div>
    <div
      class="jftsmask"
      :style="{ height: clientHeight + 'px' }"
      ref="homePage">
      <div class="jfts">学分+15</div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      clientHeight: ''
    }
  },
  mounted () {
    // 获取浏览器可视区域高度
    this.clientHeight = `${document.documentElement.clientHeight}` // document.body.clientWidth;
    window.onresize = function temp () {
      this.clientHeight = `${document.documentElement.clientHeight}`
    }
  },
  watch: {
    clientHeight: function () {
      this.changeFixed(this.clientHeight)
    }
  },
  methods: {
    changeFixed (clientHeight) { // 动态修改样式
      // console.log(clientHeight)
      this.$refs.homePage.style.height = clientHeight + 'px'
    }
  }
}
</script>
<style>
.jftsmask {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 99999999999;
}
.jfts {
  width: 74px;
  height: 41px;
  font-family: PingFangSC-Thin;
  font-size: 13px;
  line-height: 41px;
  text-align: center;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 5px;
  opacity: 0.8;
  position: absolute;
  top: 254px;
  right: 40%;
}
</style>
